package cn.junki.sparkbigmodeldemo.entity.response;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 星火大模型对话接口响应封装
 *
 * @author Junki
 * @date 2023-09-21 14:24:19
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class SparkBigModelChatResponse {

    private Header header;

    private Payload payload;

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class Header {
        private Integer code; // 0-成功
        private String message;
        private String sid;
        private Integer status;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class Payload {
        private Choices choices;
        private Usage usage;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class Choices {
        private Integer status;
        private Integer seq;
        private List<ChoiceText> text;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class ChoiceText {
        private Integer index;
        private String role;
        private String content;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class Usage {
        private UsageText text;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class UsageText {
        private Integer completion_tokens;
        private Integer question_tokens;
        private Integer prompt_tokens;
        private Integer total_tokens;
    }

}
